'''
列表
'''
list1 = [1, 3, 65]
list2 = ['zhangs', 'lisi']
print(list1 + list2)
print(list1 * 3)

# 2.比较运算
list3 = [2, 3, 6]
list4 = [2, 3, 6]
print(list3 is list4)

s = 1
s2 = 1
s3 = 2
print(s is s2)
# 3.in和 not in
list5 = ['das', '2', 6]
print('2' in list5)

# 4.
list6 = ['小不点', '2', '小点', 'rqasd']
print(max(list6))
print(list('231'))

dic = {1: 'zhans', 2: 'lisi'}
print(list(dic))
print('-----------------------------')
# 相关方法
list1 = [8, 99, 65, 3]
print(list1.count(8))
list1.extend([2, 3])
print(list1)
print(list1.index(8))
list1.clear()
print(list1)

# .copy()
list1 = [1, 45, 55, 3, 6, 80]
print(id(list1))
list2 = list1.copy()
print(id(list2))

# 7.
list1.sort()
print(list1)
list1.sort(reverse=True)
print(list1)

list1 = [1, 45, 55, 3, 6, 80]
list1.sort()
list1.reverse()
print(list1)

list2 = sorted(list1)
print(list2)
s = 'hello'
s2 = sorted(s)
print(s2)

# 8.
scores = [34,89,56,45,90,34,54,20,90]
# s2 = scores[:]
# for i in s2:
#     if i < 60:
#         scores.remove(i)
# print(scores)
for i in range(len(scores)-1,-1,-1):
    if scores[i] < 60:
        scores.pop(i)
print(scores)
# print()
# for i in scores[-1::-1]:
#     print(i)
